Digital systems such as computers that display graphical information typically divide the image area displayed to the user into picture elements or pixels. The image displayed is often a rectangular array ranging from 320 pixels wide (or pixels per line) by 240 pixels high (or lines per frame) to 1280 by 1024 pixels.
If each pixel is either on or off, then only one bit of information need be stored per pixel. Typically, multiple colors or gray shades are supported, using a frame buffer or display memory of 8, 16 or 32 bits per pixel.
A problem arises in updating the pixel information in the display memory in a timely manner. If the host processor or central processing unit (CPU) of the computer system updates the display memory directly, then a data communications channel or bus with a substantial bandwidth must be provided between them. For example, if the target specification is for each pixel in a 1280 by 1024 display to be rewritten or transferred 30 times per second to provide for smooth motion, then a transfer bandwidth of approximately 42 million bits per second is required.
Such high bandwidth is expensive, both for the bus and for the memory device or CPU to store or generate the information being updated. Even a more modest example still requires substantial bandwidth: a 640 by 480 image of 8-bit pixels can be completely rewritten in about 1/2 second using 5 million bits per second. Prior art systems attempt to reduce this bandwidth requirement.
One way in which bandwidth can be reduced is to transfer only pixel information for pixels being displayed. It is possible, for example, to only transfer the pixel data and address of the pixels that have changed. However, this approach often has a drawback in that transferring an individual pixel may involve a read-modify-write operation.
Multiple pixels are often packed into a single memory or bus word. It is common for 8-bit pixels to be packed 2 per 16 bit word or 4 per 32 bit word, and for 16-bit pixels to be packed 2 per 32 bit word. To modify a single pixel in these cases, the previous contents of the display memory word must be read and the data for the unchanged pixels within that word must be rewritten along with the data for the changed pixel.
Another way in which the bandwidth required can be reduced is known as a bit block transfer or bitblit operation. In a bitblit, a rectangular region within the display memory is specified and data for pixels within the region is transferred. However, analogous problems often arise with this approach.
If the first and last pixels in the set being transferred, or in each line of the rectangle being transferred, do not happen fall on a word boundary, then the above read-modify-write cycle must be used for the display memory words that begin and end the set, or that begin and end each line of the rectangle. But unless the word boundaries within the pixel set happen to line up between the source of the modified pixels and the display memory, then transferring even the internal words requires that pixels be shifted within words.
Another way in which the bandwidth required can be reduced is known as run length encoding. In a run length encoded bitmap, a count of pixels is provided along with a single copy of the pixel data that is to be written into a contiguous set of pixels, where the length of that set is given by the pixel count. The CPU and the bus between the CPU and the display memory can be relieved of the burden of interpreting and transferring such bitmaps by having a graphics processor or accelerator accept such bitmaps from the host and update the display memory according to the run lengths that are encoded in the bitmap.
Yet another way in which the bandwidth required can be reduced is known as chroma key encoding. In a chroma key encoded bitmap, the image overlay being written into the display memory is transparent for a particular pixel. That is, pixel data transferred does not indicate a new color to be written into the pixel addressed. Thus, the graphics accelerator does not alter the pixel data within the display memory for any pixels that are so encoded in the bitmap. Typically, the particular value used as the chroma key is programmable by the applications software running on the host computer and interpreted by the graphics accelerator.
Both run length encoding and chroma key encoding suffer from the drawback that pixel data is transferred even for pixels that are unchanged. Additionally, both run length encoding and chroma key encoding suffer from the drawback that significant additional processing is often required when the pixel data transferred does not have word boundaries that align with those of the corresponding pixels in the display memory. This additional processing includes a possible read-modify-write operation at the boundaries of the set being transferred and a possible realignment of pixel data within words for all the pixels being transferred.
Still another way in which the bus and processor bandwidth required can be reduced is to have a display memory that is larger than is required to hold pixel data for the rectangular region or window being displayed. Non-displayed portions of display memory can hold bitmaps. The graphics accelerator can move these bitmaps into the display window when commanded to do so by software executing on the host CPU. However, this approach can create a performance bottleneck at the display memory because at least two access cycles are required for each word moved.
Thus, there is a need for a way to reduce the bandwidth and processing required when updating only some of the pixels within a display memory.